package com.ysstech.activiti.controller;

import java.util.Map;

import com.ysstech.activiti.service.ActivitiGroupService;
import com.ysstech.common.controller.BaseController;
import com.ysstech.common.util.resultutil.RestResult;
import com.ysstech.common.util.resultutil.ResultGenerator;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Slf4j
@Controller
@Api(tags = "用户组管理api")
@RequestMapping(value = "/activitiGroup")
public class ActivitiGroupController extends BaseController {
    @Autowired
    private ActivitiGroupService activitiGroupService;

    @RequestMapping(value = "/page")
    public String page() throws Exception {
        return "activiti/group";
    }

    @RequestMapping(value = "/listGroup")
    @ResponseBody
    public RestResult listGroup(String page, String rows) throws Exception {
        Map<String, Object> map = activitiGroupService.queryListGroup(this.getPage(page, rows));
        return ResultGenerator.getSuccessResult("查询所有用户组信息成功！", map);
    }

}
